#ifndef							__TRAYICON_H__
#define							__TRAYICON_H__

#include						<QObject>
#include						<QtWidgets/QMenu>
#include						<QtWidgets/QAction>
#include						<QtWidgets/QDialog>
#include						<QSystemTrayIcon>
#include						<QDesktopServices>
#include						<QtGui/QCloseEvent>
#include						<QtCore/QCoreApplication>
#include						<QMessageBox>
#include						<QtGui/QMouseEvent>
#include						<QShortcut>
#include						<list>
#include						<iostream>
#include						"manualconnect.h"
#include						"servermenu.h"

class							Gui;

class							TrayIcon : public QObject
{
	Q_OBJECT

public:
	TrayIcon(Gui &);
	~TrayIcon();

private:
	QSystemTrayIcon				*_sticon;
	QMenu						*_MainMenu;
	QMenu						*_Server;
	Gui							&_gui;
	ManualConnect				*_manualconnect;
	std::map<quint16, ServerMenu*>	_ServerList;

protected:
	void						closeEvent(QCloseEvent *);

public:
	void						init();
	void						displayMessage(const std::string &, const std::string &);
	void						addServer(quint16, QString &);
	void						setName(QString &, quint16);
	void						removeServer(quint16);
	void						menuStyle();
	const ManualConnect			*getDialog() const;


	public slots:
		void					close_window();
		void					manual_connect();
		void					handleMode(quint16, bool);
		void					handleConfig(quint16);
signals:
	void						changeMode(quint16, bool);
	void						config(quint16);
};

#endif							// !__TRAYICON_H__
